package com.yao.mybatis.executor;

import com.yao.mybatis.config.Configuration;
import com.yao.mybatis.config.MappedStatement;

import java.util.List;

/**
 * 用来处理二级缓存的
 * @author Administrator
 */
public class CachingExecutor implements Executor{
    /**
     * 处理一级缓存的executor
     */
    private Executor executor;

    public CachingExecutor(Executor executor) {
        this.executor = executor;
    }

    @Override
    public <E> List<E> query(MappedStatement mappedStatement, Configuration configuration, Object param) {
       //todo 二级缓存暂不实现
        return executor.query(mappedStatement,configuration,param);
    }
}
